import request from '@/utils/request'

// 获取地址列表
export const getAddressList = () => {
    return request.get('/address/list')
}

// 默认收货地址id
export const defaultId = () => {
    return request.get('/address/defaultId')
}

// 收货地址详情  
export const detail = (addressId) => {
    return request.get('address/detail', { addressId });
}

// 新增收货地址  
export const add = (data) => {
    return request.post('address/add', { form: data });
}

// 编辑收货地址  
export const edit = (addressId, data) => {
    return request.post('address/edit', { addressId, form: data });
}

// 设置默认收货地址  
export const setDefault = (addressId) => {
    return request.post('address/setDefault', { addressId });
}

// 删除收货地址  
export const remove = (addressId) => {
    return request.post('address/remove', { addressId });
}
